Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update swagger generated API crates #590

Merged
merged 2 commits into from
Feb 8, 2024
Merged

Update swagger generated API crates #590

merged 2 commits into from
Feb 8, 2024

Conversation

dani-garcia
Copy link
Member

@dani-garcia dani-garcia commented Feb 7, 2024

Type of change

- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Update swagger generator to version 7.2.0, pull in the new templates and generate the new API crates.

I've also updated the build instructions to use .NET 8, as is required in the latest server code.

The version of the server code used to generate this is bitwarden/server@fc1d7c7
I've had to make some small modifications to the server code to get it working, and I'll link the PR here shortly. bitwarden/server#3760

To make this easier to review, I've split this into three commits:

  • b42f189: Update the swagger and dotnet versions, and pull in the new templates as-is. Note that this won't generate working code.
  • 9727d46: Patched the provided templates to make it work with our code. This is in a separate commit to make it easier to see what we've changed and hopefully make it easier in the future to update these templates. The changes are:
    • Ignore warnings by default
    • Use Uuids instead of strings
    • Use serde_repr to support int enums
    • Disabled default features for reqwest (to remove default tls)
    • Removing double optionals (This could be reverted once we're better at marking everything as required in the server)
  • f9b6360: New autogenerated swagger code, no manually edited files here. Moved to a separate PR (Update autogenerated swagger files #593)

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@1595306). Click here to learn what that means.
Report is 2 commits behind head on main.

❗ Current head f9b6360 differs from pull request most recent head 9727d46. Consider uploading reports for the commit 9727d46 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #590   +/-   ##
=======================================
  Coverage        ?   57.76%           
=======================================
  Files           ?      168           
  Lines           ?     9912           
  Branches        ?        0           
=======================================
  Hits            ?     5726           
  Misses          ?     4186           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dani-garcia dani-garcia marked this pull request as ready for review February 7, 2024 15:19
@dani-garcia dani-garcia requested a review from Hinton February 7, 2024 15:19
@bitwarden-bot
Copy link

bitwarden-bot commented Feb 7, 2024

Logo
Checkmarx One – Scan Summary & Details775d5c03-91b6-4621-98ff-4661decba2ed

No New Or Fixed Issues Found

Copy link
Member

@Hinton Hinton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we might be removing some of our custom logic around uuids?

support/openapi-template/hyper/api.mustache Show resolved Hide resolved
@dani-garcia dani-garcia requested a review from Hinton February 8, 2024 10:57
@dani-garcia dani-garcia merged commit f16189c into main Feb 8, 2024
59 checks passed
@dani-garcia dani-garcia deleted the ps/update-swagger branch February 8, 2024 12:13
dani-garcia added a commit that referenced this pull request Feb 8, 2024
## Type of change
```
- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other
```

## Objective
Extracted the autogenerated code from #590
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants